<template>
    <a-config-provider :locale="locale">
        <router-view/>
    </a-config-provider>
</template>

<script>
    import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN';
    export default {
        data() {
            return {
                locale: zhCN,
            };
        },
        mounted(){
            //  绑定页面重新加载事件
            window.addEventListener('unload',this.saveState);
        },
        methods : {
            saveState(){
                sessionStorage.setItem('user_state',JSON.stringify(this.$store.state.user));
            }
        }
    };
</script>
